﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace ReducaoPena {
	class Program {

		private static String report = @"Total de pontos: {0}
Seg: {1}
Ter: {2}
Qua: {3}
Qui: {4}
Sex: {5}";
		
		static void Main(string[] args) {

		
			Int32 qnt = 0;
			Int32 total = 0;
			String tarefa;
			String[] data;

			Console.Clear();
			while (true) {
			
				Console.Write("Número de tarefas: ");
				qnt = Int32.Parse(Console.ReadLine());
				
				if(qnt == 0)
					break;
				
				TarefaCollection list = new TarefaCollection();
				
				for (int i = 0; i < qnt; i++) {
					Console.Write("Tarefa " + (i + 1) + ": ");
					tarefa = Console.ReadLine();
					data = tarefa.Split(' ');

					Tarefa t = new Tarefa(Int32.Parse(data[0]), Int32.Parse(data[1]), data[2], data[3], data[4]);
					list.Add(t);
				}

				List<Int32> diasPontos;
				list.GetBestPontuation(out diasPontos, out total);
				Console.WriteLine(String.Format(report, total, diasPontos[0], diasPontos[1], diasPontos[2], diasPontos[3], diasPontos[4]));
			}

		}

		

	}
}
